# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-persist
pkgver=0.6_git20240114
_gitrev=f569906232c3812f5f5d934130edfefbc9165d7f
pkgrel=0
_pkgreal=persist
pkgdesc="Persist Variables between Emacs Sessions"
url="https://elpa.gnu.org/packages/persist.html"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/emacsmirror/persist/archive/$_gitrev/emacs-persist-$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . -L test \
		-l persist-tests -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
0a33620a5bdf5bb720cd78202e553cc58626a5c01e48a215c1ed06b2a37343973aa39675de1e92885548bbcff111f8ebb5bc89baa377b5981901a74ee702c914  emacs-persist-f569906232c3812f5f5d934130edfefbc9165d7f.tar.gz
"
